package aptech.eproject.logictics.db;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;

/**
 * The persistent class for the TRIP_ROUTE database table.
 * 
 */
@Entity
@Table(name = "TRIP_ROUTE")
public class TripRoute implements Serializable {

    private static final long serialVersionUID = 1L;
    private TripRoutePK id;
    private Timestamp arriveDate;
    private boolean isDeleted;
    private short routeOrder;
    private TripRouteStatus status;
    private Route route;
    private Trip trip;

    public TripRoute() {
    }

    public TripRoute(TripRoutePK id, boolean isDeleted, TripRouteStatus status) {
        this.id = id;
        this.isDeleted = isDeleted;
        this.status = status;
    }

    @EmbeddedId
    public TripRoutePK getId() {
        return this.id;
    }

    public void setId(TripRoutePK id) {
        this.id = id;
    }

    @Column(name = "ARRIVE_DATE", nullable = true)
    public Timestamp getArriveDate() {
        return this.arriveDate;
    }

    public void setArriveDate(Timestamp arriveDate) {
        this.arriveDate = arriveDate;

    }

    @Column(name = "IS_DELETED", nullable = true)
    public boolean getIsDeleted() {
        return this.isDeleted;
    }

    public void setIsDeleted(boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Column(name = "ROUTE_ORDER", nullable = false)
    public short getRouteOrder() {
        return this.routeOrder;
    }

    public void setRouteOrder(short routeOrder) {
        this.routeOrder = routeOrder;
    }

    @Enumerated(EnumType.STRING)
    @Column(name = "STATUS", nullable = true)
    public TripRouteStatus getStatus() {
        return status;
    }

    public void setStatus(TripRouteStatus status) {
        this.status = status;
    }

    //bi-directional many-to-one association to Route
    @ManyToOne
    @JoinColumn(name = "ROUTE_ID", insertable = false, updatable = false)
    public Route getRoute() {
        return this.route;
    }

    public void setRoute(Route route) {
        this.route = route;
    }

    //bi-directional many-to-one association to Trip
    @ManyToOne
    @JoinColumn(name = "TRIP_ID", insertable = false, updatable = false)
    public Trip getTrip() {
        return this.trip;
    }

    public void setTrip(Trip trip) {
        this.trip = trip;
    }
}
